﻿/******************************************************************************
* File description: animationController_Practice.h
* Function: 打靶动画Controller，基于State的状态，根据时间计算当前动画的过渡状态，并提供获取当前状态的接口
* Current Version: 1.0.0
* Author: JNN
* Date: 2025-07-01
*  -----
*  Copyright by 博坤生物 .
 *****************************************************************************/

#ifndef ANIMATIONCONTROLLER_PRACTICE_H
#define ANIMATIONCONTROLLER_PRACTICE_H

#include <QTimer>
#include <QVariantMap>
#include "logHelper/debugLog.h"
#include "animationState_Practice.h"
#include "StaticProperties.h"

class AnimationController_Practice : public QObject
{
    Q_OBJECT
public:
    AnimationController_Practice(AnimationState_Practice* state);


    void            startTimer();
    void            stopTimer();
    QVariantMap     requestInfo();



public slots:
    void            updateState(double interval = -1);      // 状态计算更新 (Timer调用)
    void            reset();


private:

    AS_P::emBarState          _curBarOp = AS_P::EMPTY;
    AnimationState_Practice*  _state = nullptr;
    QTimer*         _timer = nullptr;
    double          _interval = 30;

    double          _feedPortPosi = 0;
    int             _feedPortState = 0;
    double          _wheelAngle = 0;
    int             _wheelState = 0;
    double          _barPosi = 0;
    int             _barState = 0;




};

#endif // ANIMATIONCONTROLLER_PRACTICE_H
